using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class EndPoint : MonoBehaviour, IInteractable
{
    public string interactTip;
    public void ChangeAfterInteracte()
    {

    }

    public void ChangeBeforeInteracte()
    {

    }

    public void Interacte(GameObject trigger)
    {
        GameManager.Instance.TranslateNextLevel("GameScene", GameState.Gaming);
    }
    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.gameObject.CompareTag("Player"))
        {
            collision.gameObject.GetComponent<PlayerController>().AddInteractObject(this);
        }
    }
    private void OnTriggerExit2D(Collider2D collision)
    {
        if (collision.gameObject.CompareTag("Player"))
        {
            collision.gameObject.GetComponent<PlayerController>().RemoveInteractObject(this);
        }
    }
}
